home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / Framewrk / FWPart / FWSelect.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  5.0 KB  |  160 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWSelect.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWSELECT_H
  11. #define FWSELECT_H
  12.  
  13. #ifndef FWPRTDEF_H
  14. #include "FWPrtDef.h"
  15. #endif
  16.  
  17. // ----- Foundation Includes -----
  18.  
  19. #ifndef FWSTDDEF_H
  20. #include "FWStdDef.h"
  21. #endif
  22.  
  23. #ifndef FWRUNTYP_H
  24. #include "FWRunTyp.h"
  25. #endif
  26.  
  27. // ----- OpenDoc Includes -----
  28.  
  29. #ifndef FWODTYPS_H
  30. #include "FWODTyps.h"
  31. #endif
  32.  
  33. //========================================================================================
  34. //    Forward Declarations
  35. //========================================================================================
  36.  
  37. class ODStorageUnit;
  38. class ODStorageUnitView;
  39. class ODFacet;
  40. class ODShape;
  41. class ODSession;
  42.  
  43. class FW_CPart;
  44. class FW_CFrame;
  45. class FW_CPresentation;
  46. class FW_CCloneInfo;
  47. class FW_CPromise;
  48. class FW_CPoint;
  49. class FW_CMouseEvent;
  50. class FW_CLinkSource;
  51. class FW_CContent;
  52. class FW_CLinkDestination;
  53. class FW_CString;
  54.  
  55. //========================================================================================
  56. //    constants
  57. //========================================================================================
  58.  
  59. extern const ODPropertyName FW_kPropFrameInfo;             // = "Framework:Property:FrameInfo";
  60.  
  61. //========================================================================================
  62. //    class FW_CSelection
  63. //========================================================================================
  64.  
  65. class FW_CSelection
  66. {
  67. public:
  68.     FW_DECLARE_AUTO(FW_CSelection)
  69.  
  70. //----------------------------------------------------------------------------------------
  71. //    Initialization/Destruction
  72. //
  73. public:
  74.     FW_CSelection(Environment* ev, FW_Boolean allowLinkSource, FW_Boolean allowLink);
  75.     virtual    ~FW_CSelection();
  76.  
  77. //----------------------------------------------------------------------------------------
  78. //    New API
  79. //
  80. public:
  81.     virtual FW_Boolean                IsEmpty(Environment* ev) const = 0;    
  82.     virtual void                    SelectAll(Environment* ev) = 0;
  83.     virtual void                    ClearSelection(Environment* ev) = 0;
  84.     virtual void                    CloseSelection(Environment* ev) = 0;
  85.     virtual FW_CContent*            GetSelectedContent(Environment* ev) = 0;
  86.     
  87.     // ----- Linking -----    
  88.     virtual FW_Boolean                IsSelectionLinkable(Environment* ev);
  89.     virtual FW_Boolean                CanPasteAsLink(Environment* ev, 
  90.                                             ODPasteAsMergeSetting& setting,
  91.                                             ODStorageUnit* su);
  92.  
  93.     virtual FW_CLinkSource*            DoFindLinkSource(Environment* ev);
  94.  
  95.     virtual FW_CLinkDestination*    GetLinkDestination(Environment* ev, FW_Boolean& multipleLinks);
  96.     FW_Boolean                        CanEditSelection(Environment* ev, FW_CFrame* frame);
  97.  
  98.     // ----- Selection region and hit testing -----    
  99.     virtual FW_Boolean                IsMouseInDraggableItem(Environment* ev, 
  100.                                             FW_CFrame* frame,
  101.                                             const FW_CMouseEvent& theMouseEvent, 
  102.                                             FW_Boolean inBackground);                            
  103.     virtual ODShape*                AcquireSelectionOutline(Environment* ev, 
  104.                                             ODFacet* facet, 
  105.                                             FW_CFrame* frame);
  106.     virtual ODShape*                AcquireSelectionShape(Environment* ev, 
  107.                                             ODFacet* facet, 
  108.                                             FW_CFrame* frame);
  109.  
  110.     virtual void                    UpdateSelectionOnMouseDown(Environment* ev, 
  111.                                             const FW_CMouseEvent& mouseEvent,
  112.                                             ODFacet* embeddedFacet,
  113.                                             FW_Boolean inEmbeddedFrameBorder,
  114.                                             FW_Boolean inBackground);
  115.  
  116.     // ----- Selection Info -----
  117.     virtual FW_Boolean                GetSelectionInfoString(Environment* ev, FW_CString& infoString);
  118.     virtual FW_Handled                ShowSelectionInfo(Environment* ev);
  119.                                                 
  120.     // ----- Getters/Setters -----
  121.     FW_CPresentation*                GetPresentation(Environment* ev) const;
  122.     FW_CPart*                        GetPart(Environment* ev) const;
  123.  
  124. //----------------------------------------------------------------------------------------
  125. //    For Internal Use Only
  126. //
  127. public:    
  128.     void                            PrivSetPresentation(FW_CPresentation* presentation);
  129.     
  130. //----------------------------------------------------------------------------------------
  131. //    Data Members
  132. //
  133. protected:
  134.     FW_CPresentation*                fPresentation;
  135.     FW_Boolean                        fAllowLinkSource;
  136.     FW_Boolean                        fAllowLink;
  137. };
  138.  
  139. //========================================================================================
  140. //    FW_CSelection Inlines
  141. //========================================================================================
  142.  
  143. //----------------------------------------------------------------------------------------
  144. //    FW_CSelection::GetPresentation
  145. //----------------------------------------------------------------------------------------
  146. inline FW_CPresentation* FW_CSelection::GetPresentation(Environment*) const
  147. {
  148.     return fPresentation;
  149. }
  150.  
  151. //----------------------------------------------------------------------------------------
  152. //    FW_CSelection::PrivSetPresentation
  153. //----------------------------------------------------------------------------------------
  154. inline void FW_CSelection::PrivSetPresentation(FW_CPresentation*  presentation)
  155. {
  156.     fPresentation = presentation;
  157. }
  158.  
  159. #endif
  160.